<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>01 transition</title>
    <style>
        #box {
            width: 300px;
            height: 300px;
            background-color: yellow;
            /* transition-property: width; */
            /* transition-duration: 5s; */
        }
        /* #box:hover {
            width: 500px;
            height: 500px;
            background-color: green;
    }
    */
    </style>
</head>

<body>
    <div id="box">
        transition
    </div>

    <script>
        var box = document.getElementById('box');
        box.onmouseover = function() {
            console.log(this.style);
            this.style.width = '500px';
            this.style.height = '500px';
            this.style.transitionDuration = '2s';
            this.style.backgroundColor = 'green';
        }

        box.onmouseout = function() {
            this.style.width = '300px';
            this.style.height = '300px';
            this.style.transitionDuration = '2s';
            this.style.backgroundColor = 'yellow';
        }
    </script>
</body>

</html>